import vue from 'vue'
import Vuex from 'vuex'

vue.use(Vuex)

const store = new Vuex.Store({
  state:{
    nickName: '',
    cartCount: 0
  },
  mutations: {
    updataUserInfo ( state,nickName ) {
      state.nickName = nickName
    },
    updataCartCount ( state, cartCount){
      state.cartCount += cartCount
    },
    initCartCount(state,cartCount){
      state.cartCount = cartCount ;
    }
  }
})

export default store
